package com.magicalcoder.pigeon.client;

import com.magicalcoder.pigeon.common.dto.RmtAddress;

import java.lang.reflect.Proxy;
import java.util.concurrent.CopyOnWriteArrayList;

/**
 * Created by hzhedongyu on 2017/5/26.
 */
public class PigeonClient {

    public PigeonClient() {
    }

    public <T> T newInstance(Class<T> service,String serviceName){
        ClientProxy proxy = new ClientProxy(serviceName);

        return (T)Proxy.newProxyInstance(
                service.getClassLoader(),
                new Class<?>[]{service},
                proxy
                );
    }

}